package com.wyh.domain.enums.g3enums;

import com.wyh.domain.po.g3po.BillingItemsEnum;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;

public enum SpecialNameEnum {//预存
    WATER(0, "水费预存"),
    ELECTRICITY(1, "电费预存"),
    GAS(2, "气费预存"),
    PROPERTY_FEE(3,"物业费预存"),
    UTILITY_COSTS(4,"通用预存");

    private final Integer code;
    private final String description;
    private static final SpecialNameEnum[] ALL_SPECIAL_NAME=SpecialNameEnum.values();

    SpecialNameEnum(int code, String description) {
        this.code = code;
        this.description = description;
    }
    //获取其中一个
    public static String getByCode(int code) {
        for (SpecialNameEnum name : SpecialNameEnum.values()) {
            if (name.code == code) {
                return name.getDescription();
            }
        }
        return null;
    }

    public static HashMap<Integer, String> getAllSpecialName() {
        HashMap<Integer, String> hashMap = new HashMap<>();
        for (SpecialNameEnum value : SpecialNameEnum.values()) {
            hashMap.put(value.getCode(),value.getDescription());
        }

        return hashMap;
    }

    public Integer getCode() {
        return code;
    }

    public String getDescription() {
        return description;
    }
}
